package facilius.controller.action.tiponota;

import facilius.model.ServiceLocator;
import facilius.model.pojo.TipoNota;
import org.mentawai.core.BaseAction;

/**
 *
 * @author Graciano
 */
public class TipoNotaUpdateAction extends BaseAction{

    @Override
    public String execute() throws Exception {
        String consequence = ERROR;
        try {
            TipoNota aux = new TipoNota();
            aux.setId(input.getLong("id"));
            aux.setDescricao(input.getString("descricao"));
            aux.setOficial(input.getBoolean("oficial"));

            ServiceLocator.getTipoNotaService().update(aux);

            consequence = SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return consequence;
    }

}
